package com.spark.data

import android.os.Bundle
import android.view.View
import com.google.gson.Gson
import com.spark.common.BaseFragment
import com.spark.data.model.BorrowListModel
import kotlinx.android.synthetic.main.frag_apply_info.*

/**
 * the detail of data what u applyed
 */
class ApplyInfoFragment : BaseFragment() {
    private var borrowItemModel: BorrowListModel.ResultMap? = null

    companion object {
        fun newInstance(borrowItemStr: String): ApplyInfoFragment {
            val target = ApplyInfoFragment()
            val args = Bundle()
            args.putString("borrowItem",borrowItemStr)
            target.arguments = args
            return target
        }
    }

    override fun contentResId(): Int {
        return R.layout.frag_apply_info
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        borrowItemModel = arguments?.getString("borrowItem")?.let { Gson().fromJson(it, BorrowListModel.ResultMap::class.java) }

        iv_back.setOnClickListener { pop() }
        tv_state.text = "审核中"

    }
}